spinoff
simple library for displaying spinners in the terminal
π¨ Install
Add as a dependency to your Cargo.toml
:
[]
= "0.5.4"
β‘ Usage
use ;
use sleep;
use Duration;
let spinner = new;
sleep;
spinner.success;
Update a spinner
use ;
use sleep;
use Duration;
let mut spinner = new;
sleep;
spinner.update;
sleep;
spinner.stop
Stop a spinner and persist a symbol and message
use ;
use sleep;
use Duration;
let spinner = new;
sleep;
spinner.stop_and_persist;
Specify an output stream
use ;
use sleep;
use Duration;
let spinner = new_with_stream;
sleep;
spinner.stop_and_persist;
βNote for Windows Users
For colors to work properly, you need to add a few extra lines to your code:
use control
enable_virtual_terminal.unwrap;
Other examples can be found in the documentation.
π Documentation
- All relevant documentation can be found on the Docs.rs page.
- If you want to see all the available
Spinner
options, check theSpinners
enum.
β Examples
To run some of the included examples, use:
π§ Contributing
Any contributions to this crate are highly appreciated. If you have any ideas/suggestions/bug fixes, please open an issue or a pull request. If you like the project, star this project on GitHub.
π License
This crate is licensed under the MIT license.